/*
 * Copyright (c) 2008-2021 浩瀚深度 All Rights Reserved.
 *
 * <p>FileName: NetworkTopologyApp.java</p>
 *
 * @author zz
 * @date 2024/5/23
 * @version 1.0
 * History:
 * v1.0.0 2024/5/23 Create
 */
package com.jason.zax.controller;

/**
 * <p>Title: NetworkTopologyApp</p>
 * <p>Description: </p>
 *
 * @author zz
 */

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;

import java.io.IOException;
import java.util.List;

public class NetworkTopologyApp extends Application {

    @Override
    public void start(Stage primaryStage) {
        try {
            List<NetworkDevice> networkDevices = SNMPManager.discoverNetwork("172.16.20.36", "public");
            Pane root = new Pane();
            Scene scene = new Scene(root, 800, 600);

            for (NetworkDevice device : networkDevices) {
                Circle deviceNode = new Circle(20);
                deviceNode.setCenterX(Math.random() * 700);
                deviceNode.setCenterY(Math.random() * 500);
                root.getChildren().add(deviceNode);
            }

            primaryStage.setScene(scene);
            primaryStage.show();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        launch(args);
    }
}
